------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/florianhollenbach/Dropbox/BayesProbit/Replication/Application/log_file_stata_application.log
  log type:  text
 opened on:   4 Dec 2017, 08:14:02

. ********************************************************
. ******          Replication Code for              ******
. ******     Bayesian versus maximum likelihood     ******
. ******      estimation of treatment effects       ******
. ******          in bivariate probit               ******  
. ******       instrumentalvariable models          ******    
. ********************************************************
. ******                                            ******  
. ******                4/18/2017                   ******         
. ******     this file runs stata code to estimate  ******
. ******      the Stata  models for the application ******
. ********************************************************
. 
. 
. 
. 
. set more off, permanently
(set more preference recorded)

. **** set appropriate working directory
. 
. 
. use "perry.data.dta"

. 
. set seed 12345

. 
. biprobit (antvote = diplomaonly) (diplomaonly = treatment), vce(bootstrap, reps(500))
(running biprobit on estimation sample)

Bootstrap replications (500)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..............x.......x...........................   450
..................................................   500

Seemingly unrelated bivariate probit            Number of obs     =        123
                                                Replications      =        498
                                                Wald chi2(2)      =       7.08
Log likelihood = -133.17954                     Prob > chi2       =     0.0290

------------------------------------------------------------------------------
             |   Observed   Bootstrap                         Normal-based
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
antvote      |
 diplomaonly |   1.083523   .8275299     1.31   0.190    -.5384061    2.705451
       _cons |   -1.60177   .4839227    -3.31   0.001    -2.550241   -.6532986
-------------+----------------------------------------------------------------
diplomaonly  |
   treatment |   .5286016    .224747     2.35   0.019     .0881056    .9690975
       _cons |  -.1395013   .1567744    -0.89   0.374    -.4467735    .1677709
-------------+----------------------------------------------------------------
     /athrho |  -.3871386   1.031646    -0.38   0.707    -2.409129    1.634851
-------------+----------------------------------------------------------------
         rho |  -.3688908   .8912596                     -.9839678    .9267494
------------------------------------------------------------------------------
LR test of rho=0: chi2(1) = .274734                       Prob > chi2 = 0.6002
Note: One or more parameters could not be estimated in 2 bootstrap replicates;
      standard-error estimates include only complete replications.

. matrix result = J(8,3,.)

. 
. matrix result[1,1] = _b[diplomaonly:_cons]

. matrix result[2,1] = _se[diplomaonly:_cons]

. matrix result[3,1] = _b[diplomaonly:treatment]

. matrix result[4,1] = _se[diplomaonly:treatment]

. 
. 
. matrix result[5,1] = _b[antvote:_cons]

. matrix result[6,1] = _se[antvote:_cons]

. matrix result[7,1] = _b[antvote:diplomaonly]

. matrix result[8,1] = _se[antvote:diplomaonly]

. 
. 
. eststo: ivreg2 antvote (diplomaonly = treatment), first savefirst savefprefix(alpha1)

Stored estimation results
-------------------------
----------------------------------------------------------------------------------
        name | command      depvar       npar  title 
-------------+--------------------------------------------------------------------
alpha1dipl~y | ivreg2       diplomaonly     2  First-stage regression: diplomaonly
----------------------------------------------------------------------------------

First-stage regressions
-----------------------


First-stage regression of diplomaonly:

Statistics consistent for homoskedasticity only
Number of obs =                    123
------------------------------------------------------------------------------
 diplomaonly |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   treatment |   .2055556   .0886231     2.32   0.022     .0301028    .3810083
       _cons |   .4444444    .061897     7.18   0.000      .321903    .5669859
------------------------------------------------------------------------------
F test of excluded instruments:
  F(  1,   121) =     5.38
  Prob > F      =   0.0220
Sanderson-Windmeijer multivariate F test of excluded instruments:
  F(  1,   121) =     5.38
  Prob > F      =   0.0220



Summary results for first-stage regressions
-------------------------------------------

                                           (Underid)            (Weak id)
Variable     | F(  1,   121)  P-val | SW Chi-sq(  1) P-val | SW F(  1,   121)
diplomaonly  |       5.38    0.0220 |        5.47   0.0194 |        5.38

Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                   10% maximal IV size             16.38
                                   15% maximal IV size              8.96
                                   20% maximal IV size              6.66
                                   25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Sanderson-Windmeijer F statistic.

Underidentification test
Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
Ha: matrix has rank=K1 (identified)
Anderson canon. corr. LM statistic       Chi-sq(1)=5.24     P-val=0.0221

Weak identification test
Ho: equation is weakly identified
Cragg-Donald Wald F statistic                                       5.38

Stock-Yogo weak ID test critical values for K1=1 and L1=1:
                                   10% maximal IV size             16.38
                                   15% maximal IV size              8.96
                                   20% maximal IV size              6.66
                                   25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.

Weak-instrument-robust inference
Tests of joint significance of endogenous regressors B1 in main equation
Ho: B1=0 and orthogonality conditions are valid
Anderson-Rubin Wald test           F(1,121)=       0.74     P-val=0.3915
Anderson-Rubin Wald test           Chi-sq(1)=      0.75     P-val=0.3859
Stock-Wright LM S statistic        Chi-sq(1)=      0.75     P-val=0.3874

Number of observations               N  =        123
Number of regressors                 K  =          2
Number of endogenous regressors      K1 =          1
Number of instruments                L  =          2
Number of excluded instruments       L1 =          1

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics consistent for homoskedasticity only

                                                      Number of obs =      123
                                                      F(  1,   121) =     0.72
                                                      Prob > F      =   0.3972
Total (centered) SS     =  16.06504065                Centered R2   =  -0.0181
Total (uncentered) SS   =           19                Uncentered R2 =   0.1392
Residual SS             =   16.3559776                Root MSE      =    .3647

------------------------------------------------------------------------------
     antvote |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 diplomaonly |   .2741313   .3200097     0.86   0.392    -.3530762    .9013387
       _cons |    .005148   .1773881     0.03   0.977    -.3425263    .3528224
------------------------------------------------------------------------------
Underidentification test (Anderson canon. corr. LM statistic):           5.236
                                                   Chi-sq(1) P-val =    0.0221
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):                5.380
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments):           0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         diplomaonly
Excluded instruments: treatment
------------------------------------------------------------------------------
(est1 stored)

. eststo: ivreg2 antvote (diplomaonly = treatment), fuller(1) first savefirst savefprefix(alpha2)

Stored estimation results
-------------------------
----------------------------------------------------------------------------------
        name | command      depvar       npar  title 
-------------+--------------------------------------------------------------------
alpha2dipl~y | ivreg2       diplomaonly     2  First-stage regression: diplomaonly
----------------------------------------------------------------------------------

First-stage regressions
-----------------------


First-stage regression of diplomaonly:

Statistics consistent for homoskedasticity only
Number of obs =                    123
------------------------------------------------------------------------------
 diplomaonly |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   treatment |   .2055556   .0886231     2.32   0.022     .0301028    .3810083
       _cons |   .4444444    .061897     7.18   0.000      .321903    .5669859
------------------------------------------------------------------------------
F test of excluded instruments:
  F(  1,   121) =     5.38
  Prob > F      =   0.0220
Sanderson-Windmeijer multivariate F test of excluded instruments:
  F(  1,   121) =     5.38
  Prob > F      =   0.0220



Summary results for first-stage regressions
-------------------------------------------

                                           (Underid)            (Weak id)
Variable     | F(  1,   121)  P-val | SW Chi-sq(  1) P-val | SW F(  1,   121)
diplomaonly  |       5.38    0.0220 |        5.47   0.0194 |        5.38

Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                    5% maximal Fuller rel. bias    24.09
                                   10% maximal Fuller rel. bias    19.36
                                   20% maximal Fuller rel. bias    15.64
                                   30% maximal Fuller rel. bias    12.71
                                    5% Fuller maximum bias         23.81
                                   10% Fuller maximum bias         19.40
                                   20% Fuller maximum bias         15.39
                                   30% Fuller maximum bias         12.76
NB: Critical values based on Fuller parameter=1
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for i.i.d. errors only.

Underidentification test
Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
Ha: matrix has rank=K1 (identified)
Anderson canon. corr. LM statistic       Chi-sq(1)=5.24     P-val=0.0221

Weak identification test
Ho: equation is weakly identified
Cragg-Donald Wald F statistic                                       5.38

Stock-Yogo weak ID test critical values for K1=1 and L1=1:
                                    5% maximal Fuller rel. bias    24.09
                                   10% maximal Fuller rel. bias    19.36
                                   20% maximal Fuller rel. bias    15.64
                                   30% maximal Fuller rel. bias    12.71
                                    5% Fuller maximum bias         23.81
                                   10% Fuller maximum bias         19.40
                                   20% Fuller maximum bias         15.39
                                   30% Fuller maximum bias         12.76
NB: Critical values based on Fuller parameter=1
Source: Stock-Yogo (2005).  Reproduced by permission.

Weak-instrument-robust inference
Tests of joint significance of endogenous regressors B1 in main equation
Ho: B1=0 and orthogonality conditions are valid
Anderson-Rubin Wald test           F(1,121)=       0.74     P-val=0.3915
Anderson-Rubin Wald test           Chi-sq(1)=      0.75     P-val=0.3859
Stock-Wright LM S statistic        Chi-sq(1)=      0.75     P-val=0.3874

Number of observations               N  =        123
Number of regressors                 K  =          2
Number of endogenous regressors      K1 =          1
Number of instruments                L  =          2
Number of excluded instruments       L1 =          1

LIML estimation
---------------
k               =0.99174
lambda          =1.00000
Fuller parameter=1    

Estimates efficient for homoskedasticity only
Statistics consistent for homoskedasticity only

                                                      Number of obs =      123
                                                      F(  1,   121) =     0.71
                                                      Prob > F      =   0.3995
Total (centered) SS     =  16.06504065                Centered R2   =  -0.0045
Total (uncentered) SS   =           19                Uncentered R2 =   0.1507
Residual SS             =  16.13718828                Root MSE      =    .3622

------------------------------------------------------------------------------
     antvote |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 diplomaonly |   .2488437   .2918894     0.85   0.394    -.3232489    .8209363
       _cons |   .0189225   .1623163     0.12   0.907    -.2992115    .3370566
------------------------------------------------------------------------------
Underidentification test (Anderson canon. corr. LM statistic):           5.236
                                                   Chi-sq(1) P-val =    0.0221
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):                5.380
Stock-Yogo weak ID test critical values:  5% maximal Fuller rel. bias    24.09
                                         10% maximal Fuller rel. bias    19.36
                                         20% maximal Fuller rel. bias    15.64
                                         30% maximal Fuller rel. bias    12.71
                                          5% Fuller maximum bias         23.81
                                         10% Fuller maximum bias         19.40
                                         20% Fuller maximum bias         15.39
                                         30% Fuller maximum bias         12.76
NB: Critical values based on Fuller parameter=1
Source: Stock-Yogo (2005).  Reproduced by permission.
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments):           0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Anderson-Rubin statistic (overidentification test of all instruments):   0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         diplomaonly
Excluded instruments: treatment
------------------------------------------------------------------------------
(est2 stored)

. 
. 
. clear

. use "ihad.data.dta"

. 
. set seed 12345

. 
. biprobit (antvote = diplomaonly) (diplomaonly = treatment), vce(bootstrap, reps(500))
(running biprobit on estimation sample)

Bootstrap replications (500)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
.....................x............................   200
........................................x..x......   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500

Seemingly unrelated bivariate probit            Number of obs     =         58
                                                Replications      =        497
                                                Wald chi2(2)      =       1.47
Log likelihood = -73.473177                     Prob > chi2       =     0.4796

------------------------------------------------------------------------------
             |   Observed   Bootstrap                         Normal-based
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
antvote      |
 diplomaonly |   1.050738   1.031282     1.02   0.308    -.9705385    3.072014
       _cons |  -1.012852    .715863    -1.41   0.157    -2.415917    .3902141
-------------+----------------------------------------------------------------
diplomaonly  |
   treatment |   .5128254   .7584967     0.68   0.499    -.9738008    1.999452
       _cons |   .2947324   .1944578     1.52   0.130    -.0863979    .6758628
-------------+----------------------------------------------------------------
     /athrho |  -.8711572    9.53651    -0.09   0.927    -19.56237    17.82006
-------------+----------------------------------------------------------------
         rho |  -.7019616   4.837394                            -1           1
------------------------------------------------------------------------------
LR test of rho=0: chi2(1) = .508777                       Prob > chi2 = 0.4757
Note: One or more parameters could not be estimated in 3 bootstrap replicates;
      standard-error estimates include only complete replications.

. 
. matrix result[1,2] =  _b[diplomaonly:_cons]

. matrix result[2,2] = _se[diplomaonly:_cons]

. matrix result[3,2] = _b[diplomaonly:treatment]

. matrix result[4,2] = _se[diplomaonly:treatment]

. 
. 
. matrix result[5,2] =  _b[antvote:_cons]

. matrix result[6,2] =  _se[antvote:_cons]

. matrix result[7,2] =  _b[antvote:diplomaonly]

. matrix result[8,2] =  _se[antvote:diplomaonly]

. 
. eststo: ivreg2 antvote (diplomaonly = treatment), first savefirst savefprefix(alpha3)

Stored estimation results
-------------------------
----------------------------------------------------------------------------------
        name | command      depvar       npar  title 
-------------+--------------------------------------------------------------------
alpha3dipl~y | ivreg2       diplomaonly     2  First-stage regression: diplomaonly
----------------------------------------------------------------------------------

First-stage regressions
-----------------------


First-stage regression of diplomaonly:

Statistics consistent for homoskedasticity only
Number of obs =                     58
------------------------------------------------------------------------------
 diplomaonly |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   treatment |   .1740891   .1315901     1.32   0.191    -.0895175    .4376957
       _cons |   .6153846   .0753158     8.17   0.000      .464509    .7662602
------------------------------------------------------------------------------
F test of excluded instruments:
  F(  1,    56) =     1.75
  Prob > F      =   0.1912
Sanderson-Windmeijer multivariate F test of excluded instruments:
  F(  1,    56) =     1.75
  Prob > F      =   0.1912



Summary results for first-stage regressions
-------------------------------------------

                                           (Underid)            (Weak id)
Variable     | F(  1,    56)  P-val | SW Chi-sq(  1) P-val | SW F(  1,    56)
diplomaonly  |       1.75    0.1912 |        1.81   0.1782 |        1.75

Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                   10% maximal IV size             16.38
                                   15% maximal IV size              8.96
                                   20% maximal IV size              6.66
                                   25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Sanderson-Windmeijer F statistic.

Underidentification test
Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
Ha: matrix has rank=K1 (identified)
Anderson canon. corr. LM statistic       Chi-sq(1)=1.76     P-val=0.1849

Weak identification test
Ho: equation is weakly identified
Cragg-Donald Wald F statistic                                       1.75

Stock-Yogo weak ID test critical values for K1=1 and L1=1:
                                   10% maximal IV size             16.38
                                   15% maximal IV size              8.96
                                   20% maximal IV size              6.66
                                   25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.

Weak-instrument-robust inference
Tests of joint significance of endogenous regressors B1 in main equation
Ho: B1=0 and orthogonality conditions are valid
Anderson-Rubin Wald test           F(1,56)=        0.41     P-val=0.5226
Anderson-Rubin Wald test           Chi-sq(1)=      0.43     P-val=0.5126
Stock-Wright LM S statistic        Chi-sq(1)=      0.43     P-val=0.5141

Number of observations               N  =         58
Number of regressors                 K  =          2
Number of endogenous regressors      K1 =          1
Number of instruments                L  =          2
Number of excluded instruments       L1 =          1

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics consistent for homoskedasticity only

                                                      Number of obs =       58
                                                      F(  1,    56) =     0.33
                                                      Prob > F      =   0.5689
Total (centered) SS     =  13.39655172                Centered R2   =  -0.2512
Total (uncentered) SS   =           21                Uncentered R2 =   0.2018
Residual SS             =  16.76185325                Root MSE      =    .5376

------------------------------------------------------------------------------
     antvote |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 diplomaonly |    .503876   .8639337     0.58   0.560    -1.189403    2.197155
       _cons |   .0232558   .5851939     0.04   0.968    -1.123703    1.170215
------------------------------------------------------------------------------
Underidentification test (Anderson canon. corr. LM statistic):           1.758
                                                   Chi-sq(1) P-val =    0.1849
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):                1.750
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments):           0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         diplomaonly
Excluded instruments: treatment
------------------------------------------------------------------------------
(est3 stored)

. eststo: ivreg2 antvote (diplomaonly = treatment), fuller(1) first savefirst savefprefix(alpha4)

Stored estimation results
-------------------------
----------------------------------------------------------------------------------
        name | command      depvar       npar  title 
-------------+--------------------------------------------------------------------
alpha4dipl~y | ivreg2       diplomaonly     2  First-stage regression: diplomaonly
----------------------------------------------------------------------------------

First-stage regressions
-----------------------


First-stage regression of diplomaonly:

Statistics consistent for homoskedasticity only
Number of obs =                     58
------------------------------------------------------------------------------
 diplomaonly |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   treatment |   .1740891   .1315901     1.32   0.191    -.0895175    .4376957
       _cons |   .6153846   .0753158     8.17   0.000      .464509    .7662602
------------------------------------------------------------------------------
F test of excluded instruments:
  F(  1,    56) =     1.75
  Prob > F      =   0.1912
Sanderson-Windmeijer multivariate F test of excluded instruments:
  F(  1,    56) =     1.75
  Prob > F      =   0.1912



Summary results for first-stage regressions
-------------------------------------------

                                           (Underid)            (Weak id)
Variable     | F(  1,    56)  P-val | SW Chi-sq(  1) P-val | SW F(  1,    56)
diplomaonly  |       1.75    0.1912 |        1.81   0.1782 |        1.75

Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                    5% maximal Fuller rel. bias    24.09
                                   10% maximal Fuller rel. bias    19.36
                                   20% maximal Fuller rel. bias    15.64
                                   30% maximal Fuller rel. bias    12.71
                                    5% Fuller maximum bias         23.81
                                   10% Fuller maximum bias         19.40
                                   20% Fuller maximum bias         15.39
                                   30% Fuller maximum bias         12.76
NB: Critical values based on Fuller parameter=1
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for i.i.d. errors only.

Underidentification test
Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
Ha: matrix has rank=K1 (identified)
Anderson canon. corr. LM statistic       Chi-sq(1)=1.76     P-val=0.1849

Weak identification test
Ho: equation is weakly identified
Cragg-Donald Wald F statistic                                       1.75

Stock-Yogo weak ID test critical values for K1=1 and L1=1:
                                    5% maximal Fuller rel. bias    24.09
                                   10% maximal Fuller rel. bias    19.36
                                   20% maximal Fuller rel. bias    15.64
                                   30% maximal Fuller rel. bias    12.71
                                    5% Fuller maximum bias         23.81
                                   10% Fuller maximum bias         19.40
                                   20% Fuller maximum bias         15.39
                                   30% Fuller maximum bias         12.76
NB: Critical values based on Fuller parameter=1
Source: Stock-Yogo (2005).  Reproduced by permission.

Weak-instrument-robust inference
Tests of joint significance of endogenous regressors B1 in main equation
Ho: B1=0 and orthogonality conditions are valid
Anderson-Rubin Wald test           F(1,56)=        0.41     P-val=0.5226
Anderson-Rubin Wald test           Chi-sq(1)=      0.43     P-val=0.5126
Stock-Wright LM S statistic        Chi-sq(1)=      0.43     P-val=0.5141

Number of observations               N  =         58
Number of regressors                 K  =          2
Number of endogenous regressors      K1 =          1
Number of instruments                L  =          2
Number of excluded instruments       L1 =          1

LIML estimation
---------------
k               =0.98214
lambda          =1.00000
Fuller parameter=1    

Estimates efficient for homoskedasticity only
Statistics consistent for homoskedasticity only

                                                      Number of obs =       58
                                                      F(  1,    56) =     0.22
                                                      Prob > F      =   0.6374
Total (centered) SS     =  13.39655172                Centered R2   =  -0.0981
Total (uncentered) SS   =           21                Uncentered R2 =   0.2995
Residual SS             =  14.71055719                Root MSE      =    .5036

------------------------------------------------------------------------------
     antvote |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 diplomaonly |   .3113957   .6456502     0.48   0.630    -.9540554    1.576847
       _cons |   .1526822   .4391515     0.35   0.728     -.708039    1.013403
------------------------------------------------------------------------------
Underidentification test (Anderson canon. corr. LM statistic):           1.758
                                                   Chi-sq(1) P-val =    0.1849
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):                1.750
Stock-Yogo weak ID test critical values:  5% maximal Fuller rel. bias    24.09
                                         10% maximal Fuller rel. bias    19.36
                                         20% maximal Fuller rel. bias    15.64
                                         30% maximal Fuller rel. bias    12.71
                                          5% Fuller maximum bias         23.81
                                         10% Fuller maximum bias         19.40
                                         20% Fuller maximum bias         15.39
                                         30% Fuller maximum bias         12.76
NB: Critical values based on Fuller parameter=1
Source: Stock-Yogo (2005).  Reproduced by permission.
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments):           0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Anderson-Rubin statistic (overidentification test of all instruments):   0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         diplomaonly
Excluded instruments: treatment
------------------------------------------------------------------------------
(est4 stored)

. 
. 
. clear

. use "star.data.dta"

. 
. set seed 12345

. 
. biprobit (antvote = diplomaonly) (diplomaonly = treatment), vce(bootstrap, reps(500))
(running biprobit on estimation sample)

Bootstrap replications (500)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..........................x.......................   250
................................................x.   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500

Seemingly unrelated bivariate probit            Number of obs     =        811
                                                Replications      =        498
                                                Wald chi2(2)      =       5.89
Log likelihood = -862.23714                     Prob > chi2       =     0.0525

------------------------------------------------------------------------------
             |   Observed   Bootstrap                         Normal-based
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
antvote      |
 diplomaonly |   1.947878   .9214786     2.11   0.035     .1418131    3.753943
       _cons |  -1.850364   .8155327    -2.27   0.023    -3.448779   -.2519496
-------------+----------------------------------------------------------------
diplomaonly  |
   treatment |   .2458215   .1331452     1.85   0.065    -.0151382    .5067812
       _cons |   1.036962   .0674334    15.38   0.000     .9047948    1.169129
-------------+----------------------------------------------------------------
     /athrho |  -1.991738   1.495603    -1.33   0.183    -4.923066    .9395899
-------------+----------------------------------------------------------------
         rho |  -.9634392   .1073618                     -.9998941    .7350338
------------------------------------------------------------------------------
LR test of rho=0: chi2(1) = 1.52321                       Prob > chi2 = 0.2171
Note: One or more parameters could not be estimated in 2 bootstrap replicates;
      standard-error estimates include only complete replications.

. 
. matrix result[1,3] = _b[diplomaonly:_cons]

. matrix result[2,3] =  _se[diplomaonly:_cons]

. matrix result[3,3] =  _b[diplomaonly:treatment]

. matrix result[4,3] =  _se[diplomaonly:treatment]

. 
. 
. matrix result[5,3] =  _b[antvote:_cons]

. matrix result[6,3] =  _se[antvote:_cons]

. matrix result[7,3] =  _b[antvote:diplomaonly]

. matrix result[8,3] =  _se[antvote:diplomaonly]

. 
. eststo: ivreg2 antvote (diplomaonly = treatment) , first savefirst savefprefix(alpha5)

Stored estimation results
-------------------------
----------------------------------------------------------------------------------
        name | command      depvar       npar  title 
-------------+--------------------------------------------------------------------
alpha5dipl~y | ivreg2       diplomaonly     2  First-stage regression: diplomaonly
----------------------------------------------------------------------------------

First-stage regressions
-----------------------


First-stage regression of diplomaonly:

Statistics consistent for homoskedasticity only
Number of obs =                    811
------------------------------------------------------------------------------
 diplomaonly |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   treatment |    .051062   .0258498     1.98   0.049     .0003215    .1018025
       _cons |   .8497317   .0144094    58.97   0.000     .8214474    .8780159
------------------------------------------------------------------------------
F test of excluded instruments:
  F(  1,   809) =     3.90
  Prob > F      =   0.0486
Sanderson-Windmeijer multivariate F test of excluded instruments:
  F(  1,   809) =     3.90
  Prob > F      =   0.0486



Summary results for first-stage regressions
-------------------------------------------

                                           (Underid)            (Weak id)
Variable     | F(  1,   809)  P-val | SW Chi-sq(  1) P-val | SW F(  1,   809)
diplomaonly  |       3.90    0.0486 |        3.91   0.0480 |        3.90

Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                   10% maximal IV size             16.38
                                   15% maximal IV size              8.96
                                   20% maximal IV size              6.66
                                   25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Sanderson-Windmeijer F statistic.

Underidentification test
Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
Ha: matrix has rank=K1 (identified)
Anderson canon. corr. LM statistic       Chi-sq(1)=3.89     P-val=0.0485

Weak identification test
Ho: equation is weakly identified
Cragg-Donald Wald F statistic                                       3.90

Stock-Yogo weak ID test critical values for K1=1 and L1=1:
                                   10% maximal IV size             16.38
                                   15% maximal IV size              8.96
                                   20% maximal IV size              6.66
                                   25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.

Weak-instrument-robust inference
Tests of joint significance of endogenous regressors B1 in main equation
Ho: B1=0 and orthogonality conditions are valid
Anderson-Rubin Wald test           F(1,809)=       1.50     P-val=0.2213
Anderson-Rubin Wald test           Chi-sq(1)=      1.50     P-val=0.2204
Stock-Wright LM S statistic        Chi-sq(1)=      1.50     P-val=0.2208

Number of observations               N  =        811
Number of regressors                 K  =          2
Number of endogenous regressors      K1 =          1
Number of instruments                L  =          2
Number of excluded instruments       L1 =          1

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics consistent for homoskedasticity only

                                                      Number of obs =      811
                                                      F(  1,   809) =     1.26
                                                      Prob > F      =   0.2626
Total (centered) SS     =  199.4796547                Centered R2   =  -0.1898
Total (uncentered) SS   =          354                Uncentered R2 =   0.3295
Residual SS             =  237.3499063                Root MSE      =     .541

------------------------------------------------------------------------------
     antvote |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 diplomaonly |   .9022661   .8038789     1.12   0.262    -.6733077     2.47784
       _cons |  -.3445016   .6960953    -0.49   0.621    -1.708823     1.01982
------------------------------------------------------------------------------
Underidentification test (Anderson canon. corr. LM statistic):           3.893
                                                   Chi-sq(1) P-val =    0.0485
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):                3.902
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments):           0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         diplomaonly
Excluded instruments: treatment
------------------------------------------------------------------------------
(est5 stored)

. eststo: ivreg2 antvote (diplomaonly = treatment), fuller(1) first savefirst savefprefix(alpha6)

Stored estimation results
-------------------------
----------------------------------------------------------------------------------
        name | command      depvar       npar  title 
-------------+--------------------------------------------------------------------
alpha6dipl~y | ivreg2       diplomaonly     2  First-stage regression: diplomaonly
----------------------------------------------------------------------------------

First-stage regressions
-----------------------


First-stage regression of diplomaonly:

Statistics consistent for homoskedasticity only
Number of obs =                    811
------------------------------------------------------------------------------
 diplomaonly |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   treatment |    .051062   .0258498     1.98   0.049     .0003215    .1018025
       _cons |   .8497317   .0144094    58.97   0.000     .8214474    .8780159
------------------------------------------------------------------------------
F test of excluded instruments:
  F(  1,   809) =     3.90
  Prob > F      =   0.0486
Sanderson-Windmeijer multivariate F test of excluded instruments:
  F(  1,   809) =     3.90
  Prob > F      =   0.0486



Summary results for first-stage regressions
-------------------------------------------

                                           (Underid)            (Weak id)
Variable     | F(  1,   809)  P-val | SW Chi-sq(  1) P-val | SW F(  1,   809)
diplomaonly  |       3.90    0.0486 |        3.91   0.0480 |        3.90

Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                    5% maximal Fuller rel. bias    24.09
                                   10% maximal Fuller rel. bias    19.36
                                   20% maximal Fuller rel. bias    15.64
                                   30% maximal Fuller rel. bias    12.71
                                    5% Fuller maximum bias         23.81
                                   10% Fuller maximum bias         19.40
                                   20% Fuller maximum bias         15.39
                                   30% Fuller maximum bias         12.76
NB: Critical values based on Fuller parameter=1
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for i.i.d. errors only.

Underidentification test
Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
Ha: matrix has rank=K1 (identified)
Anderson canon. corr. LM statistic       Chi-sq(1)=3.89     P-val=0.0485

Weak identification test
Ho: equation is weakly identified
Cragg-Donald Wald F statistic                                       3.90

Stock-Yogo weak ID test critical values for K1=1 and L1=1:
                                    5% maximal Fuller rel. bias    24.09
                                   10% maximal Fuller rel. bias    19.36
                                   20% maximal Fuller rel. bias    15.64
                                   30% maximal Fuller rel. bias    12.71
                                    5% Fuller maximum bias         23.81
                                   10% Fuller maximum bias         19.40
                                   20% Fuller maximum bias         15.39
                                   30% Fuller maximum bias         12.76
NB: Critical values based on Fuller parameter=1
Source: Stock-Yogo (2005).  Reproduced by permission.

Weak-instrument-robust inference
Tests of joint significance of endogenous regressors B1 in main equation
Ho: B1=0 and orthogonality conditions are valid
Anderson-Rubin Wald test           F(1,809)=       1.50     P-val=0.2213
Anderson-Rubin Wald test           Chi-sq(1)=      1.50     P-val=0.2204
Stock-Wright LM S statistic        Chi-sq(1)=      1.50     P-val=0.2208

Number of observations               N  =        811
Number of regressors                 K  =          2
Number of endogenous regressors      K1 =          1
Number of instruments                L  =          2
Number of excluded instruments       L1 =          1

LIML estimation
---------------
k               =0.99876
lambda          =1.00000
Fuller parameter=1    

Estimates efficient for homoskedasticity only
Statistics consistent for homoskedasticity only

                                                      Number of obs =      811
                                                      F(  1,   809) =     1.21
                                                      Prob > F      =   0.2711
Total (centered) SS     =  199.4796547                Centered R2   =  -0.1109
Total (uncentered) SS   =          354                Uncentered R2 =   0.3740
Residual SS             =  221.5997043                Root MSE      =    .5227

------------------------------------------------------------------------------
     antvote |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 diplomaonly |   .7641966   .6930063     1.10   0.270    -.5940708    2.122464
       _cons |  -.2249889   .6001456    -0.37   0.708    -1.401253    .9512749
------------------------------------------------------------------------------
Underidentification test (Anderson canon. corr. LM statistic):           3.893
                                                   Chi-sq(1) P-val =    0.0485
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):                3.902
Stock-Yogo weak ID test critical values:  5% maximal Fuller rel. bias    24.09
                                         10% maximal Fuller rel. bias    19.36
                                         20% maximal Fuller rel. bias    15.64
                                         30% maximal Fuller rel. bias    12.71
                                          5% Fuller maximum bias         23.81
                                         10% Fuller maximum bias         19.40
                                         20% Fuller maximum bias         15.39
                                         30% Fuller maximum bias         12.76
NB: Critical values based on Fuller parameter=1
Source: Stock-Yogo (2005).  Reproduced by permission.
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments):           0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Anderson-Rubin statistic (overidentification test of all instruments):   0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         diplomaonly
Excluded instruments: treatment
------------------------------------------------------------------------------
(est6 stored)

. 
. **** output table in csv with biprobit results and latex tables with 2SLS results
. putexcel set results_biprobit, replace
Note: file will be replaced when the first putexcel command is issued

. putexcel A1 = matrix(result)
file results_biprobit.xlsx saved

. 
. esttab using "SondheimerGreen_2sls.tex", label se star(* 0.1 ** 0.05 *** 0.01) obslast replace 
(output written to SondheimerGreen_2sls.tex)

. esttab alpha* using "SondheimerGreen_2sls_first.tex", label se star(* 0.1 ** 0.05 *** 0.01) obslast replace 
(note: file SondheimerGreen_2sls_first.tex not found)
(output written to SondheimerGreen_2sls_first.tex)

. 
. log close
      name:  <unnamed>
       log:  /Users/florianhollenbach/Dropbox/BayesProbit/Replication/Application/log_file_stata_application.log
  log type:  text
 closed on:   4 Dec 2017, 09:35:57
------------------------------------------------------------------------------------------------------------------------
